package cn.tedu.spring.life;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.util.Date;
@Component
public class Life {
    private String mean;
    public Life(){
        System.out.println("1调用无参构造实例化");
    }
    @Value("夜影月重霞")
    public void setMean(String mean){
        this.mean=mean;
        System.out.println("2调用set方法进行属性赋值");
    }
    @PostConstruct
    public void init(){
        System.out.println("3生命周期初始化方法");
    }
    @PreDestroy
    public void distory(){
        System.out.println("5销毁方法");
    }
}
